home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / LITTLE / P3SRC.ZIP / ATARI / PRISM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-07  |  3.2 KB  |  101 lines

  1. /****************************************************************************
  2. *                   prism.h
  3. *
  4. *  This module contains all defines, typedefs, and prototypes for PRISM.C.
  5. *
  6. *  from Persistence of Vision(tm) Ray Tracer
  7. *  Copyright 1996 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. *  NOTICE: This source code file is provided so that users may experiment
  10. *  with enhancements to POV-Ray and to port the software to platforms other
  11. *  than those supported by the POV-Ray Team.  There are strict rules under
  12. *  which you are permitted to use this file.  The rules are in the file
  13. *  named POVLEGAL.DOC which should be distributed with this file. If
  14. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  16. *  Forum.  The latest version of POV-Ray may be found there as well.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23.  
  24.  
  25. #ifndef PRISM_H
  26. #define PRISM_H
  27.  
  28.  
  29.  
  30. /*****************************************************************************
  31. * Global preprocessor definitions
  32. ******************************************************************************/
  33.  
  34. #define PRISM_OBJECT (STURM_OK_OBJECT)
  35.  
  36. #define LINEAR_SPLINE    1
  37. #define QUADRATIC_SPLINE 2
  38. #define CUBIC_SPLINE     3
  39.  
  40. #define LINEAR_SWEEP 1
  41. #define CONIC_SWEEP  2
  42.  
  43. /* Generate additional prism statistics. */
  44.  
  45. #define PRISM_EXTRA_STATS 1
  46.  
  47.  
  48.  
  49. /*****************************************************************************
  50. * Global typedefs
  51. ******************************************************************************/
  52.  
  53. typedef struct Prism_Struct PRISM;
  54. typedef struct Prism_Spline_Struct PRISM_SPLINE;
  55. typedef struct Prism_Spline_Entry_Struct PRISM_SPLINE_ENTRY;
  56.  
  57. struct Prism_Spline_Entry_Struct
  58. {
  59.   DBL x1, y1, x2, y2;  /* Min./Max. coordinates of segment   */
  60.   UV_VECT A, B, C, D;  /* Coefficients of segment            */
  61. };
  62.  
  63. struct Prism_Spline_Struct
  64. {
  65.   int References;
  66.   PRISM_SPLINE_ENTRY *Entry;
  67. };
  68.  
  69. struct Prism_Struct
  70. {
  71.   OBJECT_FIELDS
  72.   int Number;
  73.   int Spline_Type;       /* Spline type (linear, quadratic ...)        */
  74.   int Sweep_Type;        /* Sweep type (linear, conic)                 */
  75.   TRANSFORM *Trans;
  76.   DBL Height1, Height2;
  77.   DBL x1, y1, x2, y2;    /* Overall bounding rectangle of spline curve */
  78.   PRISM_SPLINE *Spline;  /* Pointer to array of splines                */
  79. };
  80.  
  81.  
  82.  
  83. /*****************************************************************************
  84. * Global variables
  85. ******************************************************************************/
  86.  
  87.  
  88.  
  89.  
  90. /*****************************************************************************
  91. * Global functions
  92. ******************************************************************************/
  93.  
  94. PRISM *Create_Prism PARAMS((void));
  95. void  Compute_Prism_BBox PARAMS((PRISM *Prism));
  96. void  Compute_Prism PARAMS((PRISM *Prism, UV_VECT *P));
  97.  
  98.  
  99.  
  100. #endif
  101.